// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 获取设备类型列表 GET /api/device/type */
export async function queryDeviceType(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  options?: { [key: string]: any },
) {
  return request<API.RequestData>('/api/device/type', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}


/** 获取设备类型列表 GET /api/device/type */
export async function queryDeviceTypeList() {
  return request<API.RequestData>('/api/device/type/list', {
    method: 'GET',
  });
}


/** 更新设备类型 PUT /api/device/type */
export async function updateDeviceType(body: API.DeviceTypeItem, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/device/type', {
    method: 'PUT',
    requestType: 'form',
    data: body,
    ...(options || {}),
  });
}

/** 添加设备类型 POST /api/device/type */
export async function addDeviceType(body: API.DeviceTypeItem, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/device/type', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 根据id删除设备类型 DELETE /api/device/type */
export async function removeDeviceType(
  params: {
    // query
    /** 设备类型Id */
    typeId?: number;
  },
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/device/type', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}


export async function validTypeId(params: any) {
  return request('/api/device/type/validTypeId', {
    params,
  });
}
